﻿using Bigway.Common.Models.DbModels;
using SqlSugar;

namespace Benefactor.Models.DbModels;

public class BenefitsCardOrder : DeletableEntity
{
    [SugarColumn(IsNullable = false)]
    public string BuyerAccount { get; set; }

    [SugarColumn(IsNullable = false)]
    public string BenefitsCardId { get; set; }

    [SugarColumn(IsNullable = true)]
    public string? RefererAccount { get; set; }

    [SugarColumn(IsNullable = true)]
    public double? RefererFee { get; set; } // 推广人分润

    [SugarColumn(IsNullable = false)]
    public string IssuedBenefitsCardId { get; set; }

    [SugarColumn(IsNullable = false)]
    public string IssuedBenefitsCardNo { get; set; }

    [SugarColumn(IsNullable = false)]
    public string OrderNo { get; set; }

    [SugarColumn(IsNullable = false)]
    public double PaidAmount { get; set; }

    [SugarColumn(IsNullable = false)]
    public DateTime PaidTime { get; set; }

    // 订单状态 已经支付,佣金已支付,关闭
    [SugarColumn(IsNullable = false)]
    public string BenefitsCardOrderStatusCode { get; set; } = Statics.PaidBenefitsCardOrderStatus;

    [SugarColumn(IsIgnore = true)]
    public BenefitsCardOrderStatus? BenefitsCardOrderStatus { get; set; }

    [Navigate(NavigateType.OneToOne, nameof(BenefitsCardId))]
    public BenefitsCard? BenefitsCard { get; set; }
}